<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Query\Builder as QueryBuilder;
class DBServiceProvider extends ServiceProvider
{
    public function boot() {
        // 返回数组列表
        QueryBuilder::macro('getLists', function () {
            return \GuzzleHttp\json_decode(\GuzzleHttp\json_encode($this->get()));
        });
    }
}